public class test {
    public static void main(String[] args) {
        int i = 1;
        int count = 0;
        while (i <= 100) {
            if (i % 10 == 9 && i / 10 != 9) {
                count++;
            }
            if (i % 10 == 9 && i / 10 == 9) {
                count++;
                count++;
            }
            i++;
        }
        System.out.println("数字9 出现的次数" + count);
    }
}